package com.sky.controller.user;

import com.sky.entity.Dish;
import com.sky.result.Result;
import com.sky.service.DishService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @projectName: sky-take-out
 * @package: com.sky.controller.user
 * @className: UserDishController
 * @author: Eric
 * @description: TODO
 * @date: 2023/9/26 15:45
 * @version: 1.0
 */
@RestController
@RequestMapping("/user/dish")
@Slf4j
public class UserDishController {
    @Autowired
    private DishService dishService;

    @GetMapping("/list")
    public Result dishList(Long categoryId){
        List<Dish> dishList = dishService.dishList(categoryId);
        return Result.success(dishList);
    }
}
